matrice=[[1,6,7,8],[9,10,5,12],[4,2,11,3]]


def transpose(matrice,ligne,colone):
    matricet=initmatrice(colone,ligne)
    for i in range(len(matrice)):
        for j in range(len(matrice[i])):
            matricet[j][i] = matrice[i][j]
    return matricet

def initmatrice(ligne,colone):
    tab =[]
    tmp=[]
    for i in range(ligne):
        for j in range(colone):
            tmp.append(0)
        tab.append(tmp)
        tmp=[]
    return tab

def sommeelemmatrice(matrice):
    s=0
    for i in range(len(matrice)):
        for j in range(len(matrice[i])):
            s = s+matrice[i][j]
    return s

def produitmatrice(m1,m2):
  m = []
  for i in range(len(m1)):
    ligne = []
    for j in range(len(m2[0])):
      s = 0
      for k in range(len(m1[0])):
        s = s + m1[i][k] * m2[k][j]
      ligne.append(s)
    m.append(ligne)
  return m
